var mongoose = require('mongoose');
//连接数据库
mongoose.connect('mongodb://localhost/test', {useNewUrlParser: true});
var Schema = mongoose.Schema;

var tickSchma = new Schema({
    tick_id:{
        type:String,
        required:true
    },
    account:{
        type:String,
        required: true
    },
    ticket_typeid:{
        type:String,
        required:true
    },
    ticket_typename:{
        type:String,
        required:true
    },
    auth:{
        type:String,
        required:true
    },
    created_time:{
        type:Date,
        default:Date.now
    },
    school:{
        type:String,
        default:'0'
    },
    people:{
        type:Number,
        default:'0'
    },
    agency:{
        type:String,
        default:'0'
    },
    guide:{
        type:String,
        default:'0'
    },
    authority:{
        type:String,
        default:'0'
    },
    free_time:{
        type:Date,
        default:'0'
    },
    car_number:{
        type:String,
        default:'0'
    },
    car_time:{
        type:Number,
        default:'8',
    }
});

module.exports = mongoose.model('Ticket', tickSchma);